# -*- coding:utf-8 -*-
import unittest,datetime
from RequestAssertion import RequestAssertion
from requests_toolbelt import MultipartEncoder

class TestCaseSet(unittest.TestCase):
    '''网站、彩票、活动'''
    #token = Land.token()
    main_url = 'http://admin-service-api.yhtest0.com'
    respones = RequestAssertion()

    #断言
    def assertionT(self,method,url,interfaceName,data=None,headers=None):
        main_url = TestCaseSet().main_url
        respones  = TestCaseSet().respones.request(method,main_url,url,data,headers)
        self.assertEqual(respones.status_code, 200)
        self.assertIn(respones.json().get('message'), ['操作成功','ok','成功','登录成功'])
        print(TestCaseSet.respones.consuming(respones,interfaceName))

    def nowTime(self):
        name = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S').replace("-","").replace(":","").replace(" ","")
        return name  # 获取现在时间

    def test_website_homepage(self):
        ''' 网站-首页设置'''
        # self.assertionT('get','/lottery/1.0/lottery/query?pageNum=1&pageSize=15','/lottery/1.0/lottery/query?pageNum=1&pageSize=15,网站-首页设置-游戏描述')
        # self.assertionT('get', '/indexDisplay/1.0/room/list', '/indexDisplay/1.0/room/list,网站-首页设置-游戏描述')
        # self.assertionT('get', '/indexDisplay/1.0/query', '/indexDisplay/1.0/query,网站-首页设置-游戏描述')
        # self.assertionT('get', '/lottery/1.0/lottery/query?pageNum=2&pageSize=15', '/lottery/1.0/lottery/query?pageNum=2&pageSize=15,网站-首页设置-游戏描述')
        # id = TestCaseSet().respones.request('get',TestCaseSet().main_url,'/lottery/1.0/lottery/query?pageNum=1&pageSize=15').json().get("data").get("data")[0].get("id")
        #
        # data = {"id":id,"remark":"彩种描述接口自动化"}
        # self.assertionT('post_x', '/indexDisplay/1.0/game/describe', '/indexDisplay/1.0/game/describe,网站-首页设置-游戏描述',data)
        #
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=TRADITION', '/indexDisplay/1.0/room/list?modeCode=TRADITION,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28','/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28&lotteryCode=2',
        #                 '/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28&lotteryCode=2,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=XY28&lotteryCode=2',
        #                 '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=XY28&lotteryCode=2,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=2',
        #                 '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=2,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC',
        #                 '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=15',
        #                 '/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=15,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=SSC&lotteryCode=15',
        #                 '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=SSC&lotteryCode=15,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=15',
        #                 '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=15,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC',
        #                 '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28',
        #                 '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28,网站-首页设置-首页展示排序')
        #
        # datas = '''[{"displays":[{"lotteryCode":"CQSSC","lotteryName":"重庆时时彩","hallId":78,"roomId":14,"modeCode":"TRADITION","modeName":"传统模式","describe":"彩种描述","streamUrl":"","pic":"http://192.168.10.35/pics/7020.jpg","sort":1},{"lotteryCode":"CQSSC","lotteryName":"重庆时时彩","hallId":79,"roomId":18,"modeCode":"LIVE","modeName":"直播模式","describe":"房间名称","streamUrl":"111","pic":"http://192.168.10.35/pics/7020.jpg","sort":2},{"lotteryCode":"WFC","lotteryName":"五分彩","hallId":78,"roomId":14,"modeCode":"TRADITION","modeName":"传统模式","describe":"彩种描述","streamUrl":"","pic":"http://192.168.10.35/pics/7020.jpg","sort":3},{"lotteryCode":"BJXY28","lotteryName":"北京幸运28","hallId":1,"roomId":1,"modeCode":"ROOM","modeName":"房间模式","describe":"彩种描述接口自动化","streamUrl":"","pic":"http://upload.qianlong.com/2019/0129/1548729441967.jpg","sort":4}],"partName":"part1"},{"displays":[{"lotteryCode":"BJXY28","lotteryName":"北京幸运28","hallId":1,"roomId":3,"modeCode":"ROOM","modeName":"房间模式","describe":"彩种描述aaatest","streamUrl":"","pic":"http://upload.qianlong.com/2019/0129/1548729441967.jpg","sort":1}],"partName":"part2"}]'''
        # m = MultipartEncoder(fields={'datas': datas})
        # headers = {'Content-Type': m.content_type}
        # #
        # self.assertionT('post_x', '/indexDisplay/1.0/insert',
        #                 '/indexDisplay/1.0/insert,网站-首页设置-首页展示排序',m,headers)
        # self.assertionT('get', '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28',
        #                 '/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28,网站-首页设置-首页展示排序')
        # self.assertionT('get', '/indexDisplay/1.0/query',
        #                 '/indexDisplay/1.0/query,网站-首页设置-首页展示排序')

    # def test_website_advertisement(self):
    #     ''' 网站-广告管理'''
    #     self.assertionT('get', '/indexAds/1.0/query?pageSize=10&pageNum=1',
    #                     '/indexAds/1.0/query?pageSize=10&pageNum=1,网站-广告管理')
    #     self.assertionT('get', '/indexAds/1.0/query?pageSize=10&pageNum=2',
    #                     '/indexAds/1.0/query?pageSize=10&pageNum=2,网站-广告管理')
    #     id = TestCaseSet().respones.request('get', TestCaseSet().main_url,
    #                                         '/indexAds/1.0/query?pageSize=10&pageNum=1').json().get("data").get(
    #         "data")[0].get("id")
    #     data = {"name":"自动化测试","pic":"http://192.168.10.35/pics/7020.jpg","terminal":2,"location":1,"showType":0,"linkType":1,"sort":3,"status":1,"relatedContent":"www.baidu.com","id":id}
    #     self.assertionT('post_x', '/indexAds/1.0/update',
    #                     '/indexAds/1.0/update,网站-广告管理-修改',data)
    #     data = {"id":id,"status":0}
    #     self.assertionT('post_x', '/indexAds/1.0/update',
    #                     '/indexAds/1.0/update,网站-广告管理-停用', data)
    #     data = {"id": id, "status": 1}
    #     self.assertionT('post_x', '/indexAds/1.0/update',
    #                     '/indexAds/1.0/update,网站-广告管理-启动', data)
    #
    #     m = MultipartEncoder(fields={'id': id})
    #     headers = {'Content-Type': m.content_type}
    #     self.assertionT('post_x', '/indexAds/1.0/delete',
    #                     '/indexAds/1.0/update,网站-广告管理-删除',m,headers)
    #
    #     self.assertionT('get', '/indexAds/1.0/query?terminal=0&location=1&showType=0&status=1&linkType=1&pageSize=10&pageNum=1',
    #                     '/indexAds/1.0/query?terminal=0&location=1&showType=0&status=1&linkType=1&pageSize=10&pageNum=1,网站-广告管理-查询')
    #
    #     self.assertionT('get',
    #                     '/indexAds/1.0/query?terminal=0&location=1&showType=0&status=0&linkType=1&pageSize=10&pageNum=1',
    #                     '/indexAds/1.0/query?terminal=0&location=1&showType=0&status=0&linkType=1&pageSize=10&pageNum=1,网站-广告管理-查询')
    #
    #
    # def test_user_membership_management(self):
    #     ''' 用户-用户管理'''
    #     username = TestCaseSet().nowTime()
    #     self.assertionT('get', '/userTag/1.0/list?pageNum=1&pageSize=100',
    #                     '/userTag/1.0/list?pageNum=1&pageSize=100,用户-用户管理')
    #     self.assertionT('get', '/user/1.0/info/list?pageSize=50&pageNum=1',
    #                     '/user/1.0/info/list?pageSize=50&pageNum=1,用户-用户管理')
    #     self.assertionT('get', '/user/1.0/info/list?pageSize=50&pageNum=2',
    #                     '/user/1.0/info/list?pageSize=50&pageNum=2,用户-用户管理')
    #     self.assertionT('get', '/userTag/1.0/list?pageNum=2&pageSize=100',
    #                     '/userTag/1.0/list?pageNum=2&pageSize=100,用户-用户管理')
    #
    #     # 查询存在bug
    #     # 标签按钮存在bug
    #     data = {"username":username,"password":111111,"isTest":0}
    #     self.assertionT('post_x', '/user/1.0/register',
    #                     '/user/1.0/register,用户-用户管理-新增用户',data)
    #     id = TestCaseSet().respones.request('get', TestCaseSet().main_url,
    #                                         '/user/1.0/info/list?pageSize=50&pageNum=1&username='+str(username)).json().get("data").get("data")[0].get("id")
    #     data={"id":id,"status":0}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-停用',data)
    #     data = {"id": id, "status": 1}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-启用', data)
    #     self.assertionT('get', '/user/1.0/info?uid='+str(id),
    #                     '/user/1.0/info?uid=,用户-用户管理-用户详情')
    #     self.assertionT('get', '/userBankAccount/accountList?userId=' + str(id),
    #                     '/userBankAccount/accountList?userId=,用户-用户管理-用户详情')
    #     self.assertionT('get', '/bank/list',
    #                     '/bank/list,用户-用户管理-用户详情')
    #     self.assertionT('get', '/userAccount/1.0/dml?userId=' + str(id),
    #                     '/userAccount/1.0/dml?userId=,用户-用户管理-用户详情')
    #     data = {"id": id, "password": 111111}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-重置登录密码', data)
    #     data = {"id": id, "password": 1111}
    #     self.assertionT('post_x', '/userAccount/1.0/update',
    #                     '/userAccount/1.0/update,用户-用户管理-用户详情-重置登录密码', data)
    #     data = {"id": id, "idCard":500104199405098756,"realName":"自动化测试"}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-用户改名', data)
    #     self.assertionT('get', '/user/1.0/info?uid='+str(id),
    #                     '/user/1.0/info?uid=,用户-用户管理-用户详情-用户改名')
    #     data = {"id": id, "qq":212112,"weixin":11211,"address":"自动化测试","remark":"自动化测试"}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-保存基本信息', data)
    #     data = {"id": id, "status": 3}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-封号', data)
    #     data = {"id": id, "status": 0}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-解封', data)
    #     data = {"id": id, "status": 1}
    #     self.assertionT('post_x', '/user/1.0/info/setting',
    #                     '/user/1.0/info/setting,用户-用户管理-用户详情-启用', data)
    #     self.assertionT('get', '/userBankAccount/accountList?userId=' + str(id),
    #                     '/userBankAccount/accountList?userId=,用户-用户管理-用户详情-账号余额')
    #     data = {"userId":id,"bankId":1,"bankName":"自动化测试","accountNo":6212262201023557228,"accountName":"自动化测试"}
    #     self.assertionT('post_x', '/userBankAccount/add',
    #                     '/userBankAccount/add,用户-用户管理-用户详情-新增银行卡',data)
    #     self.assertionT('get', '/userBankAccount/accountList?userId=' + str(id),
    #                     '/userBankAccount/accountList?userId=,用户-用户管理-用户详情-新增银行卡')
    #     id_y = TestCaseSet().respones.request('get', TestCaseSet().main_url,
    #                                          '/userBankAccount/accountList?userId=' + str(id)).json().get("data")[0].get("id")
    #     data = {"userId": id, "bankId": 1, "bankName": "自动化测试", "accountNo": 6212262201023557228,
    #             "accountName": "自动化测试","userBankAccountId":id_y}
    #     self.assertionT('post_x', '/userBankAccount/edit',
    #                     '/userBankAccount/edit,用户-用户管理-用户详情-修改银行卡', data)
    #     data = {"userBankAccountId": id_y}
    #     self.assertionT('post_x', '/userBankAccount/updateStatus',
    #                     '/userBankAccount/updateStatus,用户-用户管理-用户详情-银行卡-停用',data)
    #     self.assertionT('post_x', '/userBankAccount/updateStatus',
    #                     '/userBankAccount/updateStatus,用户-用户管理-用户详情-银行卡-启用', data)
    #     data = {"userBankAccountId": id_y}
    #     self.assertionT('post_x', '/userBankAccount/delete',
    #                     '/userBankAccount/delete,用户-用户管理-用户详情-银行卡-删除', data)
    #     self.assertionT('get', '/userBankAccount/accountList?userId=' + str(id),
    #                     '/userBankAccount/accountList?userId=,用户-用户管理-用户详情-账号余额')
        #订单页面有bug
        #钱包页面有bug
    def test_user_grade(self):
        ''' 用户-会员等级'''

        pass

    # def test_user_label(self):
    #     ''' 用户-会员标签'''
    #     data = {"name":"自动化测试标签","describe":"自动化测试标签","createdId":1}
    #     self.assertionT('post_x', '/userTag/1.0/insert',
    #                     '/userTag/1.0/insert,用户-会员标签-新增标签',data)
    #     self.assertionT('get', '/userTag/1.0/listAll',
    #                     '/userTag/1.0/listAll,用户-会员标签')
    #     listAll = TestCaseSet().respones.request('get', TestCaseSet().main_url,
    #                                           '/userTag/1.0/listAll').json().get("data")
    #     id = 2
    #     for i in listAll:
    #         try:
    #             i.get("name") == '自动化测试标签'
    #         except:
    #             print("标签不存在")
    #         else:
    #             id = i.get("id")
    #     data = {"name": "自动化测试标签", "describe": "自动化测试标签", "id": id}
    #     self.assertionT('post_x', '/userTag/1.0/update',
    #                     '/userTag/1.0/update,用户-会员标签-编辑标签', data)
    #     data = {"id": id}
    #     self.assertionT('post_x', '/userTag/1.0/delete',
    #                     '/userTag/1.0/delete,用户-会员标签-删除标签', data)

    def test_user_administrators(self):
        ''' 用户-管理员列表'''
        pass

    def test_user_role(self):
        ''' 用户-管理员角色'''
        pass

    # def test_user_agent(self):
    #     ''' 用户-代理层级'''
    #     self.assertionT('get', '/agentConfig/1.0/list',
    #                     '/agentConfig/1.0/list,用户-代理层级')
    #     data ={"name":"七级代理","lotteryPerecnt":10,"sportPerecnt":0,"livePerecnt":0,"gamePerecnt":0}
    #     self.assertionT('post', '/agentConfig/1.0/addConfig',
    #                     '/agentConfig/1.0/addConfig,用户-代理层级-新增代理层级',data)
    #     list = TestCaseSet().respones.request('get', TestCaseSet().main_url,
    #                                              '/agentConfig/1.0/list').json().get("data")
    #
    #     id = 1
    #     for i in list:
    #         try:
    #             i.get("name") == '七级代理'
    #         except:
    #             print("代理不存在")
    #         else:
    #             id = i.get("id")
    #     data = {"id":id,"level":7,"name":"七级代理","lotteryPerecnt":10,"sportPerecnt":0,"livePerecnt":0,"gamePerecnt":0,"count":0,"_index":7,"_rowKey":273}
    #     self.assertionT('post_x', '/agentConfig/1.0/update',
    #                     '/agentConfig/1.0/update,用户-代理-设置代理', data)
    #     data = {}
    #     self.assertionT('post_x', '/agentConfig/1.0/delete',
    #                     '/agentConfig/1.0/delete,用户-代理-删除标签', data)
    #     #编辑返佣时间存在bug

    # def test_lottery_setup(self):
    #     ''' 彩票-彩种设定'''
    #     data = {"isMainSwitch":1,"id":1,"status":0}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                         '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-总开关-关',data)
    #     data = {"isMainSwitch": 1, "id": 1, "status": 1}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                     '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-总开关-开', data)
    #     self.assertionT('get', '/lottery/1.0/lottery/lotterySwitchList',
    #                     '/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关')
    #
    #     data = {"isMainSwitch": 2, "id": 1, "status": 0}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                     '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-传统模式开关-关', data)
    #     data = {"isMainSwitch": 2, "id": 1, "status": 1}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                     '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-传统模式开关-开', data)
    #     self.assertionT('get', '/lottery/1.0/lottery/lotterySwitchList',
    #                     '/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关')
    #
    #     data = {"isMainSwitch": 2, "id": 3, "status": 0}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                     '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-直播模式开关-开', data)
    #     data = {"isMainSwitch": 2, "id": 3, "status": 1}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotterySwitch',
    #                     '/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-直播模式开关-关', data)
    #     self.assertionT('get', '/lottery/1.0/lottery/lotterySwitchList',
    #                     '/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关')
    #
    #     self.assertionT('get', '/lottery/1.0/lotteryMobilePurchase/lotteryList',
    #                     '/lottery/1.0/lotteryMobilePurchase/lotteryList,彩票-彩种设定-购彩大厅排序')
    #
    #     data = '''[{"lotteryCode":"XJSSC","seq":1},{"lotteryCode":"XYFT","seq":2},{"lotteryCode":"JSSC","seq":3},{"lotteryCode":"BJXY28","seq":4},{"lotteryCode":"XXLXY28","seq":5},{"lotteryCode":"JNDXY28","seq":6},{"lotteryCode":"XNXY28","seq":7},{"lotteryCode":"TWXY28","seq":8},{"lotteryCode":"JLPXY28","seq":9},{"lotteryCode":"GXK3","seq":10},{"lotteryCode":"JSK3","seq":11},{"lotteryCode":"AHK3","seq":12},{"lotteryCode":"JLK3","seq":13},{"lotteryCode":"CQSSC","seq":14},{"lotteryCode":"TJSSC","seq":15},{"lotteryCode":"WFC","seq":16},{"lotteryCode":"FFC","seq":17},{"lotteryCode":"FLB3FC","seq":18},{"lotteryCode":"HL1.5FC","seq":19},{"lotteryCode":"JX11X5","seq":20},{"lotteryCode":"FLB5FC","seq":21},{"lotteryCode":"JS11X5","seq":22},{"lotteryCode":"GD11X5","seq":23},{"lotteryCode":"SD11X5","seq":24},{"lotteryCode":"AH11X5","seq":25},{"lotteryCode":"SH11X5","seq":26},{"lotteryCode":"BJSC","seq":27},{"lotteryCode":"XG6HC","seq":28}]'''
    #     # m = MultipartEncoder(fields={'lotteryJson': data})
    #     # headers = {'Content-Type': m.content_type}
    #     # self.assertionT('post_x', '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq',
    #     #                 '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq,彩票-彩种设定-购彩大厅排序',m,headers)
    #     data = {'lotteryJson': data}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq',
    #                     '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq,彩票-彩种设定-购彩大厅排序', data)
    # def test_how_play(self):
    #     ''' 彩票-玩法开关'''
    #     self.assertionT('get', '/lottery/1.0/mode/list','/lottery/1.0/mode/list,彩票-玩法开关')
    #     ClassCode = ['XY28', 'SSC', 'SC', 'k3', '6HC', '11X5']
    #     for c in ClassCode:
    #         self.assertionT('get', '/lottery/1.0/lottery/list?lotteryClassCode='+c, '/lottery/1.0/lottery/list?lotteryClassCode='+c+',彩票-彩种分类')
    #
    #     lotteryCode = ['BJXY28', 'XXLXY28', 'JNDXY28', 'XNXY28', 'TWXY28', 'JLPXY28', 'CQSSC', 'TJSSC', 'XJSSC', 'WFC',
    #                    'FFC', 'FLB3FC', 'HL1.5F', 'FLB5FC', 'BJSC', 'XYFT', 'JSSC', 'BJSC', 'XYFT', 'JSSC', 'GXK3',
    #                    'AHK3', 'JLK3', 'XG6HC', 'JX11X5', 'JS115X', 'GD11X5', 'SD11X5', 'AH11X5', 'SH11X5']
    #     modeCode = ['TRADITION', 'ROOM', 'LIVE']
    #     for m in modeCode:
    #         for l in lotteryCode:
    #             self.assertionT('get', '/lottery/1.0/lotteryGame/list?lotteryCode='+l+'&modeCode='+m,
    #                     '/lottery/1.0/lotteryGame/list?lotteryCode='+l+'&modeCode='+m+'彩票-彩种名称，彩种模式')
    #     data = {"id":197,"type":1,"config":2}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateConfig', '/lottery/1.0/lotteryGame/updateConfig,彩票-玩法开关-编辑购球数',data)
    #     data = {"id": 197}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateStatus', '/lottery/1.0/mode/list,彩票-玩法开关-子玩法-关', data)
    #     data = {"id": 197}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateStatus', '/lottery/1.0/mode/list,彩票-玩法开关-子玩法-开', data)
    #     data = {"id": 197, "type": 2, "config": "选择1个数字进行投注,选中开奖号码和值即中奖自动化。"}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateConfig',
    #                     '/lottery/1.0/lotteryGame/updateConfig,彩票-玩法开关-编辑购球提示', data)
    #     data = {"id": 197, "type": 3, "config": "投注号码：5 奖结果为：113/221/122=5都表示中奖自动化自动化。"}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateConfig',
    #                     '/lottery/1.0/lottery/lotteryIconList,彩票-玩法开关-编辑中奖提示', data)

    # def test_lottery_icon(self):
    #     ''' 彩票-彩种图标'''
    #     self.assertionT('get', '/lottery/1.0/lottery/lotteryIconList', '/lottery/1.0/lottery/lotteryIconList,彩票-彩种图标')
    #     data = {"id": 197, "type": 3, "config": "投注号码：5 奖结果为：113/221/122=5都表示中奖自动化自动化。"}
    #     self.assertionT('post_x', '/lottery/1.0/lotteryGame/updateConfig',
    #                     '/lottery/1.0/lottery/lotteryIconList,彩票-彩种图标', data)
    #
    #     lotteryModeId = '''[{"lotteryModeId":1,"headIcon":"http://play-img3.ssg6.com/thumb/GALAXY/20190417/1555483956252.png","purchaseIcon":"http://play-img3.ssg6.com/thumb/GALAXY/20190417/1555483961380.png"}]'''
    #     data = {"lotteryId": 1, "lotteryModeIcons": lotteryModeId, "drawIcon": "https://tcpic.oss-cn-shenzhen.aliyuncs.com/tc/BJXY28.png"}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/updateLotteryIcons',
    #                     '/lottery/1.0/lottery/updateLotteryIcons,彩票-彩种图标', data)

    def test_odds_setup(self):
        ''' 彩票-赔率设置'''
        self.assertionT('get', '/lottery/1.0/lotteryClass/list', '/lottery/1.0/lotteryClass/list,彩票-赔率设置')
        #模式类型没有实现，目前固定是1
        lotteryClassCode = ['XY28', 'SSC', 'CQSSC', 'SC', 'k3', '6HC', '11X5']
        lotteryCode = ['BJXY28', 'XXLXY28', 'JNDXY28', 'XNXY28', 'TWXY28', 'JLPXY28', 'CQSSC', 'TJSSC', 'XJSSC', 'WFC',
                      'FFC', 'FLB3FC', 'HL1.5F', 'FLB5FC', 'BJSC', 'XYFT', 'JSSC', 'BJSC', 'XYFT', 'JSSC', 'GXK3',
                           'AHK3', 'JLK3', 'XG6HC', 'JX11X5', 'JS115X', 'GD11X5', 'SD11X5', 'AH11X5', 'SH11X5']
        for c in lotteryClassCode:
            self.assertionT('get', '/lottery/1.0/lottery/list?lotteryClassCode='+c, '/lottery/1.0/lottery/list?lotteryClassCode='+c+',彩票-赔率设置-彩种类型')
        for l in lotteryCode:
            self.assertionT('get', '/lottery/1.0/lotteryHall/selectLotteryHallList?lotteryCode='+l, '/lottery/1.0/lotteryHall/selectLotteryHallList?lotteryCode='+l+',彩票-赔率设置-彩种名称')
        # 模式类型没有实现，目前固定是1
        for l in lotteryCode:
            self.assertionT('get', '/lottery/1.0/lotteryHallGame/gameList?lotteryHallId=1&lotteryCode='+l, '/lottery/1.0/lotteryHallGame/gameList?lotteryHallId=1&lotteryCode='+l+',彩票-赔率设置-模式类型')
        #返奖率批量设置没有实现

    # def test_quota_setup(self):
    #     ''' 彩票-限额设置'''
    #     self.assertionT('get', '/lottery/1.0/lottery/skateLimitList', '/lottery/1.0/lottery/skateLimitList,彩票-限额设置')
    #     self.assertionT('get', '/lottery/1.0/lotteryClass/list', '/lottery/1.0/lotteryClass/list,彩票-限额设置')
    #     data = {"lotteryCode":"BJXY28","maxSingleSkate":0,"maxTotalSkate":1000}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/skateLimit/update/BJXY28',
    #                     '/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-所有单期投注最大限额', data)
    #     data = {"lotteryCode": "BJXY28", "maxSingleSkate": 10000, "maxTotalSkate": 1000}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/skateLimit/update/BJXY28',
    #                     '/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-个人单期投注最大限额', data)
    #     data = {"lotteryCode": "BJXY28", "maxSingleSkate": 10000, "maxTotalSkate": 1000,"minSkate":2,"hallId":4}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/skateLimit/update/BJXY28',
    #                     '/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-[传统模式]投注最小限额', data)
    #     data = {"lotteryCode": "BJXY28", "maxSingleSkate": 10000, "maxTotalSkate": 1000, "minSkate": 2, "hallId": 5}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/skateLimit/update/BJXY28',
    #                     '/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-[直播模式]投注最小限额', data)
    #     data = {"hallId":4,"minSkate":10}
    #     self.assertionT('post_x', '/lottery/1.0/lottery/skateLimit/update/XY28',
    #                     '/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-限额批量设置', data)

    def test_hall_setup(self):
        ''' 彩票-厅设置'''
        self.assertionT('get', '/lottery/1.0/lotteryClass/list', '/lottery/1.0/lotteryClass/list,彩票-厅设置')
        lotteryClassCode = ['XY28', 'SSC', 'CQSSC', 'SC', 'k3', '6HC', '11X5']
        lotteryCode = ['BJXY28', 'XXLXY28', 'JNDXY28', 'XNXY28', 'TWXY28', 'JLPXY28', 'CQSSC', 'TJSSC', 'XJSSC', 'WFC',
                       'FFC', 'FLB3FC', 'HL1.5F', 'FLB5FC', 'BJSC', 'XYFT', 'JSSC', 'BJSC', 'XYFT', 'JSSC', 'GXK3',
                       'AHK3', 'JLK3', 'XG6HC', 'JX11X5', 'JS115X', 'GD11X5', 'SD11X5', 'AH11X5', 'SH11X5']


        self.assertionT('get', '/lottery/1.0/lotteryClass/list', '/lottery/1.0/lotteryClass/list,彩票-厅设置')
        self.assertionT('get', '/lottery/1.0/lotteryClass/list', '/lottery/1.0/lotteryClass/list,彩票-厅设置')
            for c in lotteryClassCode:
                self.assertionT('get', '/lottery/1.0/lottery/list?lotteryClassCode='+c, '/lottery/1.0/lottery/list?lotteryClassCode='+c+', 彩票-厅设置')
            for l in lotteryCode:
                self.assertionT('get', '/lottery/1.0/lotteryHall/selectLotteryHallList?lotteryCode='+l, '/lottery/1.0/lotteryHall/selectLotteryHallList?lotteryCode='+l+',彩票-赔率设置-彩种名称')

    #
    # def test_1314odds_setup(self):
    #     ''' 彩票-13/14赔率设置'''
    #     self.assertionT('get', '/lottery/1.0/lottery/skateLimitList', '/lottery/1.0/lottery/skateLimitList,彩票-13/14赔率设置')
    #
    # def test_Award(self):
    #     ''' 彩票-自开奖管理'''
    #     self.assertionT('get', '/lottery/1.0/lottery/skateLimitList', '/lottery/1.0/lottery/skateLimitList,彩票-自开奖管理')
    #
    # def test_History_Award(self):
    #     ''' 彩票-历史开奖'''
    #     self.assertionT('get', '/lottery/1.0/lottery/skateLimitList', '/lottery/1.0/lottery/skateLimitList,彩票-历史开奖')
    #
    # def test_Backwater_query(self):
    #     ''' 彩票-回水查询'''
    #     self.assertionT('get', '/lottery/1.0/lottery/skateLimitList', '/lottery/1.0/lottery/skateLimitList, 彩票-回水查询')







if __name__ == "__main__":
    unittest.main()